﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Konstaller
{
    public class FlickLabel
    {

        string tx;


        /// <summary>
        /// Get or Set Text for Flicker Label
        /// </summary>
        public string Text
        {
            get { return tx; }
            set { tx = value; }
        }


        /// <summary>
        /// Draw a Flicker Label
        /// </summary>
        /// <param name="x">Set X Position</param>
        /// <param name="y">Set Y Position</param>
        /// <param name="color">Set a Label Color</param>
        /// <param name="color">Set a Label Background Color</param>
        /// <param name="FlickerColor">Set a Flicker label Color</param>
        public void Draw(int x, int y, ConsoleColor color,ConsoleColor BackColor,ConsoleColor FlickerColor)
        {

            Console.SetCursorPosition(x, y);
            Console.ForegroundColor = color;
            Console.BackgroundColor = BackColor;
            
            int cos = 0;
            int sw = 0;
        start:
           
            for (int i = 0; i < 10000; i++)
            {
                cos++;
            }

            if (cos == 10000)
            {
                if (sw == 0)
                {
                    Console.SetCursorPosition(x, y);
                    Console.ForegroundColor = FlickerColor;
                    Console.Write(Text);
                    sw = 1;
                    cos = 0;
                }
                else
                {
                    Console.SetCursorPosition(x, y);
                    Console.ForegroundColor = color;
                    Console.Write(Text);
                    sw = 0;
                    cos = 0;
                }
            }

            goto start;
        }

    }
}
